package com.sws.hm.dao;


import com.sws.hm.dto.Sysinfo;
import com.sws.hm.dto.SysinfoKey;
import com.sws.hm.entity.Cpuinfo;
import com.sws.hm.entity.Meminfo;
import com.sws.hm.entity.Sys;
import com.sws.hm.entity.Sysfileinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysinfoDao {
    int deleteByPrimaryKey(SysinfoKey key);

    int insert(Sysinfo record);

    int insertSelective(Sysinfo record);

    Sysinfo selectByPrimaryKey(SysinfoKey key);

    int updateByPrimaryKeySelective(Sysinfo record);

    int updateByPrimaryKey(Sysinfo record);

    //查询所有主机信息
    List<Sys> findAll(@Param("computerIp")String computerIp);

    //查询正在运行的主机IP
    List<String> findIpAll();


    //根据ip删除主机信息
    int deleteByIp(String computerIp);

    //修改主机备注信息
    int computerRemark(@Param("computerIp")String computerIp, @Param("computerRemark")String computerRemark);


    //修改主机在线状态
    int  updateSysifsocket(@Param("computerIp")String computerIp, @Param("ifsocket")int ifsocket);

    //根据IP查询主机信息
    List<Sys> selectSysinfo(@Param("ip")String computerIp);

    //根据IP查询最新主机信息
    Sys selectNewSysinfo(@Param("ip")String computerIp);

    //根据IP查询硬盘信息
    List<Sysfileinfo> selectSysfileinfo(@Param("ip")String computerIp);

    //根据IP查询最新硬盘信息
    Sysfileinfo selectNewSysfileinfo(@Param("ip")String computerIp);

    //根据IP查询cpu信息
    List<Cpuinfo> selectCpuinfo(@Param("ip")String computerIp);

    //根据IP查询最新cpu信息
    Cpuinfo selectNewCpuinfo(@Param("ip")String computerIp);

    //根据IP查询内存信息
    List<Meminfo> selectMeminfo(@Param("ip")String computerIp);

    //根据IP查询最新内存信息
    Meminfo selectNewMeminfo(@Param("ip")String computerIp);


}
